From e1e589bac5fa8aae2808ac262b5ca68eb4fb71d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20M=C3=BCllner?= Date: Tue, 10 Jun 2025 13:32:08 +0200 Subject: [PATCH] ci: Use run-eslint.sh wrapper to lint code snippets in docs This means we only have to deal with a single entry point for eslint, plus we get the option to produce fancy MR reports. Part-of: --- .gitlab-ci.yml | 9 +++++++-- .gitlab-ci/eslint-coding-style.sh | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 683b217f1..728ce998f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,9 +153,14 @@ eslint-doc: - .fdo.distribution-image@fedora - .gnome-shell.fedora stage: review + variables: + LINT_LOG: "eslint-docs-report.xml" script: - - export NODE_PATH=$(npm root -g) - - ./.gitlab-ci/eslint-coding-style.sh + - ./.gitlab-ci/eslint-coding-style.sh --output-file ${LINT_LOG} --format junit --stdout + artifacts: + reports: + junit: ${LINT_LOG} + when: always potfile-c-check: extends: diff --git a/.gitlab-ci/eslint-coding-style.sh b/.gitlab-ci/eslint-coding-style.sh index 39f00530e..ce839290f 100755 --- a/.gitlab-ci/eslint-coding-style.sh +++ b/.gitlab-ci/eslint-coding-style.sh @@ -37,7 +37,5 @@ input_file, output_dir = sys.argv[1:] extract_js_snippets(input_file, output_dir) EOF -eslint \ - --rule 'no-undef: off' \ - --rule 'no-unused-vars: off' \ - --rule 'no-invalid-this: off' $OUTDIR/*.js +echo Checking coding style of coding style docs +tools/run-eslint.sh "$@" $OUTDIR -- 2.39.5